//
//  MyDocument.h
//  CocOCaml
//
//	$Id: MyDocument.h,v 1.2 2003/02/27 17:35:32 wneuman Exp $
//
//  Created by William D. Neumann on Wed Feb 12 2003.
//  Copyright (c) 2003 William D. Neumann. All rights reserved.
//
//	This program is free software; you can redistribute it and/or modify
//	it under the terms of the Artistic License as published by Larry
//	Wall, either version 2.0, or (at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	Artistic License for more details.
//
//	You should have received a copy of the Artistic License with this Kit,
//	in the file named "Artistic.clarified".  If not, I'll be glad to provide
//	one.
//


#import <Cocoa/Cocoa.h>
#import "CamlController.h"
#import "History.h"

@interface MyDocument : NSDocument
{
    //	Outlets and contained objects
    IBOutlet NSTextView* camlView;
    IBOutlet NSTextView* entryView;
    IBOutlet NSTableView* historyView;
    CamlController* interpreter;
    History* currentEvents;
    NSData* rawHistoryData;

    BOOL clearToSend;

    //	Font information for displays
    NSFont* toCamlFont;
    NSColor* toCamlColor;
    NSFont* fromCamlFont;
    NSColor* fromCamlColor;
    NSFont* errorFromCamlFont;
    NSColor* errorFromCamlColor;
}

//	Actions
- (IBAction)sortHistory:(id)sender;
- (IBAction)submitCommand:(id)sender;
- (IBAction)previousHistory:(id)sender;
- (IBAction)nextHistory:(id)sender;
- (IBAction)interruptInterpreter:(id)sender;

//	Data Source methods
-(int) numberOfRowsInTableView:(NSTableView *)aTableView;
-(id) tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn
            row:(int)rowIndex;

//	UI methods
-(void) updateCamlView:(NSString *)camlOutput;

-(void) tvDoubleClicked;
-(void) reliveHistory;

// Private methods
- (void)sendCommandToInterpreter:(NSString *)theCommand;
- (void)useCurrentHistoryItem:(NSString *)theHistoryItem;

@end
